package com.mars.module.admin.entity;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.*;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.mars.module.system.entity.BaseEntity;

/**
 * 订单对象 sys_order
 *
 * @author mars
 * @date 2024-04-15
 */

@Data
@ApiModel(value = "订单对象")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("sys_order")
public class SysOrder {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "id")
    private Long id;

    @Excel(name = "地址")
    @ApiModelProperty(value = "地址")
    private Long addressId;

    @TableField(exist = false)
    @ApiModelProperty(value = "地址（中文）")
    private String addressName;

    /**
     * 订单号
     */
    @Excel(name = "订单号")
    @ApiModelProperty(value = "订单号")
    private String serialNo;
    /**
     * 总价格
     */
    @Excel(name = "总价格")
    @ApiModelProperty(value = "总价格")
    private BigDecimal totalPrice;
    /**
     * 总数量
     */
    @Excel(name = "总数量")
    @ApiModelProperty(value = "总数量")
    private Integer productSum;
    /**
     * 用户
     */
    @Excel(name = "用户")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "用户")
    private Long userId;
    /**
     * 状态
     */
    @Excel(name = "状态")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "状态")
    private Long status;


    @TableField(exist = false)
    @ApiModelProperty(value = "状态")
    private String statusName;
    /**
     * 总热量
     */
    @Excel(name = "总热量")
    @ApiModelProperty(value = "总热量")
    private String heatSum;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "商品列表")
    private List<SysOrderDetails> productList;

    @TableField(exist = false)
    @Excel(name = "用户姓名")
    @ApiModelProperty(value = "用户姓名")
    private String userName;

    @ApiModelProperty(value = "创建人ID")
    private Long createById;
}
